package com.ten.course.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ten.common.core.entity.CheckCourse;
import com.ten.common.core.vo.Result;
import com.ten.course.service.CourseCheckService;
import com.ten.course.vo.CourseCheckVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：张成（3092211427@qq.com）
 * @date ：Created in 2022/12/7 13:57
 * @description：
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/core/checkCourse")
@Api(tags = "课程审核api接口")
public class CourseCheckController {

    @Autowired
    private CourseCheckService courseCheckService;

    @ApiOperation(value = "根据条件进行分页")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "当前页码",name = "pageCurrent"),
            @ApiImplicitParam(value = "展示显示的页数",name = "pageSize")
    })
    @PostMapping("findCourseCheck/{pageCurrent}/{pageSize}")
    public Result<IPage<CheckCourse>> findCourseCheck(
            @PathVariable Integer pageCurrent,
            @PathVariable Integer pageSize,
            @RequestBody CourseCheckVo courseCheckVo){
        return courseCheckService.findCourseCheck(pageCurrent,pageSize,courseCheckVo);
    }

    /**
     * 根据课程id修改审核的状态
     * @param checkCourse 课程审核类的所有数据
     * @return
     */
    @ApiOperation(value = "根据课程id修改审核的状态")
    @PostMapping("updateCourseCheck")
    public Result updateCourseCheck(@RequestBody CheckCourse checkCourse){
        return courseCheckService.updateCourseCheck(checkCourse);
    }

    /*************************客户端controller*********************/


}